home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 June / Chip Haziran 2000.iso / prog / basic / 09 / 09.exe / wmploc.DLL / 256 / 136 < prev    next >
Encoding:
Text (UTF-16)  |  2000-03-15  |  6.3 KB  |  149 lines

  1. // All WMP Play and Open states are defined in skins\common\WMPStates.js
  2.  
  3. function InitSettings()
  4. {
  5.     UpdateEQOnOff();
  6. }
  7. /*
  8. function eqSettings(szName, iBand1, iBand2, iBand3, iBand4, iBand5, iBand6, 
  9. iBand7, iBand8, iBand9, iBand10)
  10. {
  11.     this.name = szName;
  12.     this.band1 = iBand1;
  13.     this.band2 = iBand2;
  14.     this.band3 = iBand3;
  15.     this.band4 = iBand4;
  16.     this.band5 = iBand5;
  17.     this.band6 = iBand6;
  18.     this.band7 = iBand7;
  19.     this.band8 = iBand8;
  20.     this.band9 = iBand9;
  21.     this.band10 = iBand10;
  22. }
  23.  
  24. var eqArray = new Array();
  25. eqArray[0] = new eqSettings("Default",0,0,0,0,0,0,0,0,0,0);
  26. eqArray[1] = new eqSettings("Pop",2,5,8,5,2,0,4,6,4,0);
  27. eqArray[2] = new eqSettings("Rock",1,4,1,3,6,3,6,7,8,9);
  28.  
  29. function eqPresetChange(iWhichDir)
  30. {
  31.     var iPos = giPresetPos;
  32.     iPos = iPos + iWhichDir;
  33.  
  34.     if (iPos < 0) 
  35.     {
  36.         iPos = eqArray.length -1;
  37.     } 
  38.     else if (iPos >= eqArray.length)
  39.     {
  40.         iPos = 0;
  41.     }
  42.  
  43.     eqSettingsList.value = eqArray[iPos].name;
  44.     eq.gainLevel1 = eqArray[iPos].band1;
  45.     eq.gainLevel2 = eqArray[iPos].band2;
  46.     eq.gainLevel3 = eqArray[iPos].band3;
  47.     eq.gainLevel4 = eqArray[iPos].band4;
  48.     eq.gainLevel5 = eqArray[iPos].band5;
  49.     eq.gainLevel6 = eqArray[iPos].band6;
  50.     eq.gainLevel7 = eqArray[iPos].band7;
  51.     eq.gainLevel8 = eqArray[iPos].band8;
  52.     eq.gainLevel9 = eqArray[iPos].band9;
  53.     eq.gainLevel10 = eqArray[iPos].band10;
  54.     giPresetPos = iPos;
  55. }
  56. */
  57. function UpdateEQOnOff()
  58. {
  59.     if (eq.bypass == true)
  60.     {
  61.         eqOnOffLabel.value="Off";
  62.     }
  63.     else
  64.     {
  65.         eqOnOffLabel.value="On";
  66.     }
  67. }
  68.  
  69. function ResetVideoSettings()
  70. {
  71.     vs.brightness=0;
  72.     vs.contrast=0;
  73.     vs.hue=0;
  74.     vs.saturation=0;
  75. }
  76.  
  77. function InitMetaDataDisplay()
  78. {   
  79.     var MediaInfoURL = "res://wmploc.dll/Offline_MediaInfo_NowPlaying.htm";
  80.     if(player.isOnline)
  81.     {
  82.         MediaInfoURL = "http://services.windowsmedia.com/cdinfo/QueryTOCNP.asp?WMPFriendly=true&cd=";
  83.  
  84.         if(player.CurrentPlaylist)
  85.         {
  86.             var TOC = player.CurrentPlaylist.GetItemInfo("TOC");
  87.             if(TOC)
  88.             {
  89.                 MediaInfoURL = MediaInfoURL + TOC;
  90.             }
  91.         }
  92.     }
  93.     IE1.Navigate(MediaInfoURL,0,0,0,0);
  94. }
  95.  
  96. function settingsOnOpenStateChangeEvent()
  97. {
  98.     switch (player.OpenState)
  99.     {
  100.         case osMediaChanging:
  101.             ClearSamiDisplay();
  102.             break;
  103.     }
  104. }
  105.  
  106. function InitSamiDisplay()
  107. {
  108.     var URL = "res://wmploc.dll/SamiCaptioning.htm";
  109.     IE1.Navigate(URL,0,0,0,0);
  110. }
  111.  
  112. function ClearSamiDisplay()
  113. {
  114.     handleScriptCommand("Text", "");
  115. }
  116.  
  117. function handleScriptCommand(scType, Param)
  118. {   
  119.     var Document = 0;
  120.     var ElemCollection = 0;
  121.     var Element = 0;
  122.  
  123.     if(scType == "Text" ||  scType == "<Sync")
  124.     {
  125.         // get the HTML document
  126.         Document = IE1.Document;
  127.         if(Document)
  128.         {
  129.             // get the element collection
  130.             ElemCollection = Document.all;
  131.             if(ElemCollection)
  132.             {
  133.                 // get the first element with this name
  134.                 Element = ElemCollection.item("SAMItext",0);
  135.             }
  136.             if(Element == 0)
  137.             {
  138.                 // operate on the body
  139.                 Element = Document.body;
  140.             }
  141.             if(Element)
  142.             {
  143.                 // set the element HTML to our
  144.                 Element.innerHTML = Param;
  145.             }
  146.         }    
  147.     }
  148. }
  149.